{
	"info": {
		"_postman_id": "2ac157fa-6be0-4041-9323-889c0e0daf98",
		"name": "Docmosis Tornado - API",
		"description": "# Introduction\n\n## Overview\n\nDocmosis Tornado API provides an easy way to generate dynamic documents from virtually any application.\n\nThis cutdown Postman collection contains a subset of the available Tornoad API endpoints.\n\n### Related Reading\n\nRead more about the [features of Docmosis Tornado](https://www.docmosis.com/products/tornado/).\n\nDownload the full documentation from the [Docmosis Resources Website](https://resources.docmosis.com/documentation/tornado/latest).\n\n## Key Concepts\n\n### HTTP Methods\n\nAll requests to the Tornado API should be made using the HTTPS POST method.\n\n### Content-Type\n\nThe content-type varies depending on the service being used. All services accept `multi-part/form-data`.\n\nThe /render service is the most versatile and can also accept `application/json`, `application/xml` and `application/x-www-form-urlencoded`.\n\n### Parameters\n\nWhen an access key has been set, requests should include the API access key in either the header or body parameters. All other parameters should be body parameters. The API does not use query string parameters.\n\n### Character Encoding\n\nAll data passed to the API should be UTF-8 encoded. If data is passed containing special characters, it must be UTF-8 encoded, otherwise unexpected characters may appear in resulting documents.\n\n# The Service API\n\n## Endpoint URLs\n\nDuring initial trial mode the baseURL will typically be:\n\n[http://localhost:8080/api](http://localhost:8080/api)\n\nFor example the render service is at:\n\n[http://localhost:8080/api/render](http://localhost:8080/api/render)\n\n## Response Codes and Messages\n\nFor every request made to the API, the first action should be to check the response status code to determine whether the call succeeded or failed. The choice can then be made whether to check for further information in the response body.\n\nThe API returns status codes as follows:\n\n| **Status Code** | **Definition** |\n| --- | --- |\n| 200 | Successful operation |\n| 400 | The request is not valid or indicates a not-ready status. |\n| 500 | A server error has occurred |\n| 404 | Invalid URL (not found) |\n| 429 | Too many requests |\n\nOther 4** and 5** response codes may also occur. Applications should always confirm that they received a 200 response before assuming success and processing the result.\n\nThe API also returns information about the result in JSON or XML as follows:\n\n| **Field** | **Value** |\n| --- | --- |\n| Succeeded | \"true\" or \"false\". |\n| shortMsg | A short message about the result. In the case of an error this will be a short error message. It may be blank in the case of a successful operation. |\n| longMsg | A more descriptive message about the result. In the case of an error this will be a long error message. It may be blank. |\n\n# Key Render Parameters\n\n## Sending Data\n\nThe “data” parameter should contain the data, that will be merged with the template, in JSON or XML format.\n\n## Sending Data as Parameters\n\nBy default, only the parameters listed below should be included when calling the /render service. This is known as “strict” mode and sending unknown parameters to the service will result in an error.\n\nThe parameter \"strictParams\" can be set to \"false\" to disable this behavior.\n\nIn this case unknown parameters will be treated as data and will be merged with the template.\n\n## Output Format\n\nThe format of the generated document will be determined by:\n\n• The parameter \"outputName\" and the file extension used in the file name. Eg “resume.pdf” will result in a PDF file being generated.\n\n• The parameter \"outputFormat\".\n\nNote that: \"outputFormat\" overrides any format implied by \"outputName\".\n\n## Dev/Prod Mode\n\nThe /render service works in production mode by default. Any errors that occur during the document generation process are considered fatal and the call will fail.\n\nThis may be overridden by setting the “devMode” parameter to “true”. In this case the service will do its best to generate a document and where possible errors will be highlighted in the generated document.\n\n## Contact Support:\n\nEmail: [support@docmosis.com](https://mailto:support@docmosis.com)",
		"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
		"_exporter_id": "34392741"
	},
	"item": [
		{
			"name": "Status",
			"request": {
				"auth": {
					"type": "noauth"
				},
				"method": "GET",
				"header": [
					{
						"key": "Accept",
						"value": "application/json"
					}
				],
				"url": {
					"raw": "{{baseUrl}}/status",
					"host": [
						"{{baseUrl}}"
					],
					"path": [
						"status"
					]
				},
				"description": "The Status service allows monitoring systems to determine the operational status of the system, including whether it is ready to render documents."
			},
			"response": []
		},
		{
			"name": "Get Template Sample Data",
			"request": {
				"auth": {
					"type": "noauth"
				},
				"method": "POST",
				"header": [
					{
						"key": "Content-Type",
						"value": "multipart/form-data"
					},
					{
						"key": "Accept",
						"value": "application/json"
					}
				],
				"body": {
					"mode": "formdata",
					"formdata": [
						{
							"key": "templateName",
							"value": "/samples/WelcomeTemplate.docx",
							"description": "The name of the template.",
							"type": "text"
						}
					]
				},
				"url": {
					"raw": "{{baseUrl}}/getSampleData",
					"host": [
						"{{baseUrl}}"
					],
					"path": [
						"getSampleData"
					]
				},
				"description": "The get sample data service allows sample data to be generated for a template based on the current structures in the template. The sample data can be created in JSON or XML format which can then be fed back to the render service to generate populated documents.\n\nThe service creates values like “value1”, “value2” for each field element.\n\nIf the template has an error in it, Docmosis will generate a blank data set."
			},
			"response": []
		},
		{
			"name": "Render",
			"request": {
				"auth": {
					"type": "noauth"
				},
				"method": "POST",
				"header": [
					{
						"key": "Content-Type",
						"value": "multipart/form-data"
					},
					{
						"key": "Accept",
						"value": "application/octet-stream"
					}
				],
				"body": {
					"mode": "formdata",
					"formdata": [
						{
							"key": "outputName",
							"value": "output.pdf",
							"description": "The name to give the rendered document.  If no format is specified (see outputFormat), the format of the resulting document is derived from the extension of this name.  For example, \"resume1.pdf\" implies a PDF format document.    The name may be supplied without an extension (eg \"resume1\") and the outputFormat parameter will specify the format(s) to return.\n\nIf multiple template names are specified, multiple (matching) output names can be specified to create a zip of named outputs.",
							"type": "text"
						},
						{
							"key": "templateName",
							"value": "/samples/WelcomeTemplate.docx",
							"description": "The name of the template to use.  The template must exist in the templates area.\n\nMultiple templates can be specified using the ; character to separate the templates.  With multiple template names, a single outputName for PDF output results in a single combined PDF.  In all other cases, a ZIP file will be returned containing each rendered document.",
							"type": "text"
						},
						{
							"key": "data",
							"value": "{\n  \"date\": \"value1\",\n  \"message\": \"value2\"\n}",
							"description": "The Data that will populate the document.  This may be either XML or JSON format.  The type of data given determines the format of the response.\n\n",
							"type": "text"
						},
						{
							"key": "accessKey",
							"value": "string",
							"description": "The API key.  Must be provided if set in the Tornado Console.",
							"type": "text",
							"disabled": true
						},
						{
							"key": "devMode",
							"value": "string",
							"description": "The render service can be used in development or production modes respectively.  If set to \"y\", \"yes\" or \"true\" this operation will work in \"dev\" mode, meaning that if something is incorrect in the template, data or instructions, Docmosis will do its best to produce a document.  Such a document may contain errors such as missing images and data, and wherever possible, Docmosis will highlight problems to indicate the failure.\n\nIn production mode, errors in document rendering will result in a failure result only, and no document will be produced.   The production mode is to ensure that a bad document is never produced/delivered to a recipient.   The default mode is production (that is, devMode is off).  Default = false.",
							"type": "text",
							"disabled": true
						}
					]
				},
				"url": {
					"raw": "{{baseUrl}}/render",
					"host": [
						"{{baseUrl}}"
					],
					"path": [
						"render"
					]
				},
				"description": "The /render service is the document production ‘work-horse’, and it is expected to be the main service that all applications will use.\n\nSee notes above for more details on key parameters."
			},
			"response": []
		}
	],
	"event": [
		{
			"listen": "prerequest",
			"script": {
				"type": "text/javascript",
				"packages": {},
				"requests": {},
				"exec": [
					""
				]
			}
		},
		{
			"listen": "test",
			"script": {
				"type": "text/javascript",
				"packages": {},
				"requests": {},
				"exec": [
					""
				]
			}
		}
	],
	"variable": [
		{
			"key": "baseUrl",
			"value": "http://localhost:8080/api"
		}
	]
}